package com.mrtan.service.impl;

import com.mrtan.bean.Warehouse;
import com.mrtan.mapper.WarehouseMapper;
import com.mrtan.service.WarehouseService;
import com.mrtan.vo.WarehouseMonthCountVO;
import com.mrtan.vo.WarehouseVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 方雨淳
 * @version 2023.1
 * @date 2023/12/12 15:24
 */
@Service
public class WarehouseServiceImpl implements WarehouseService {
    @Resource
    private WarehouseMapper warehouseMapper;

    @Override
    public List<Warehouse> selectAll(WarehouseVO warehouseVO) {
        return warehouseMapper.selectAllWarehouse(warehouseVO);
    }

    @Override
    public int updateWarehouse(Warehouse warehouse) {
        return warehouseMapper.updateByPrimaryKeySelective(warehouse);
    }

    @Override
    public int addNewWarehouse(Warehouse warehouse) {
        return warehouseMapper.insertSelective(warehouse);
    }

    @Override
    public String getWarehouseNames(Integer id) {
        return warehouseMapper.getWarehouseNames(id);
    }

    @Override
    public List<String> getAllWarehouseNames() {
        return warehouseMapper.getAllWarehouseNames();
    }

    @Override
    public Integer getTotalCount(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalCount(warehouseMonthCountVO);
    }

    @Override
    public Integer getProductCount(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getProductCount(warehouseMonthCountVO);
    }

    @Override
    public Integer getInandOutCount(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getInandoutCount(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalCostByProduct(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalCostByProduct(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalCostByStock(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalCostByStock(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalQuantityByWarehouse(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalQuantityByWarehouse(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalQuantityByWarehouseAndDate(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalQuantityByWarehouseAndDate(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalCostByWarehouseAndDate(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalCostByWarehouseAndDate(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalCostByWarehouseAndDates(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalCostByWarehouseAndDates(warehouseMonthCountVO);
    }

    @Override
    public Integer getTotalRevenueByWarehouseAndDate(WarehouseMonthCountVO warehouseMonthCountVO) {
        return warehouseMapper.getTotalRevenueByWarehouseAndDate(warehouseMonthCountVO);
    }
}
